USE [School]
GO

/****** Object:  Table [dbo].[ORG_Comment]    Script Date: 04/15/2012 22:48:27 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[ORG_Comment](
	[CommentId] [bigint] IDENTITY(1,1) NOT NULL,
	[TeacherId] [bigint] NULL,
	[StudentId] [bigint] NULL,
	[Comment] [nvarchar](max) NULL,
	[ViewOnSite] [bit] NOT NULL,
 CONSTRAINT [PK_ORG_Comment_1] PRIMARY KEY CLUSTERED 
(
	[CommentId] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[ORG_Comment]  WITH CHECK ADD  CONSTRAINT [FK_ORG_Comment_ORG_Comment] FOREIGN KEY([TeacherId])
REFERENCES [dbo].[ORG_Stuff] ([Id])
GO

ALTER TABLE [dbo].[ORG_Comment] CHECK CONSTRAINT [FK_ORG_Comment_ORG_Comment]
GO

ALTER TABLE [dbo].[ORG_Comment]  WITH CHECK ADD  CONSTRAINT [FK_ORG_Comment_TE_Student] FOREIGN KEY([StudentId])
REFERENCES [dbo].[TE_Student] ([Id])
GO

ALTER TABLE [dbo].[ORG_Comment] CHECK CONSTRAINT [FK_ORG_Comment_TE_Student]
GO

ALTER TABLE [dbo].[ORG_Comment] ADD  CONSTRAINT [DF_ORG_Comment_ViewOnSite]  DEFAULT ((1)) FOR [ViewOnSite]
GO


